﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
	mc:Ignorable="d"
	x:Class="Tfs.OnTheRoad.Controls.WorkItemsOverviewChartControl"
	d:DesignWidth="480" d:DesignHeight="800"
    x:Name="ChartControl" Loaded="ChartControl_Loaded">
    <Grid x:Name="summaryGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <toolkit:PerformanceProgressBar Height="20" IsIndeterminate="True"  Grid.ColumnSpan="4" Visibility="{Binding Processing, Converter={StaticResource BooleanToVisibilityConverter}}"/>
        <StackPanel Grid.Row="0" Orientation="Horizontal" Visibility="{Binding ElementName=workItemsChart,Path=Visibility}">
            <TextBlock>Work Items:</TextBlock>
            <TextBlock Text="{Binding WorkItemsCount}"  Foreground="{StaticResource PhoneAccentBrush}"/>
        </StackPanel>
        <charting:Chart Grid.Row="1" Visibility="Collapsed"
                x:Name="workItemsChart"                                   
                LegendTitle="State"
                Style="{StaticResource PhoneChartStyle}"
                Template="{StaticResource PhoneChartPortraitTemplate}">
            <charting:Chart.Resources>
                <Style TargetType="charting:LinearAxis">
                    <Setter Property="Minimum" Value="0"/>
                </Style>
            </charting:Chart.Resources>
        </charting:Chart>
    </Grid>
</UserControl>